package gui;

import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException;

public class ConsolePanel extends JPanel implements DocumentListener{
	public ConsolePanel(){
		super();
		this.setLayout(new BorderLayout());
		this.textArea = new JTextArea();
		this.scrollpane = new JScrollPane(this.textArea);
		this.add(this.scrollpane,BorderLayout.CENTER);
		this.textArea.getDocument().addDocumentListener(this);
	}
	
	public void appendText(String text){
		this.textArea.setText(text+"\n");
	}
	private JTextArea textArea = null;
	private JScrollPane scrollpane = null;
	public void changedUpdate(DocumentEvent e) {
		// TODO Auto-generated method stub
		
		
	}

	public void insertUpdate(DocumentEvent e) {
		// TODO Auto-generated method stub
		//System.out.println("!");
		
	}

	public void removeUpdate(DocumentEvent e) {
		// TODO Auto-generated method stub
		//System.out.println("!");
		//System.out.println(this.textArea.getX());
	}
}
